<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="btn-group hidden-xs" id="toolbar" role="group">
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="module:bydservice:add">
				<i class="fa fa-plus"></i>新增
			</a>
			<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="module:bydservice:remove">
				<i class="fa fa-trash-o"></i>删除
			</a>
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
				<i class="fa fa-download"> </i>导出
			</a>
		</div>
			
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('module:bydservice:edit')}]];
        var removeFlag = [[${@permission.hasPermi('module:bydservice:remove')}]];
        var datas = [[${@dict.getType('sys_normal_disable')}]];
        var datass = [[${@dict.getType('sys_user_sex')}]];
        var prefix = ctx + "module/bydservice"

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                sortName: "createTime",
                sortOrder: "desc",
                modalName: "客服",
                search: false,
                showExport: false,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '客服ID' 
				},
				{
					field : 'name', 
					title : '客服姓名' 
				},
				{
					field : 'sex', 
					title : '客服性别',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datass, value);
                    }
				},
				{
					field : 'qq', 
					title : '客服在线QQ' 
				},
				{
					field : 'phonenumber', 
					title : '客服电话' 
				},
				{
					field : 'status', 
					title : '客服状态' ,
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
				},
				{
					field : 'loginDate', 
					title : '最后登陆时间' 
				},
				{
					field : 'createTime', 
					title : '创建时间' 
				},
				{
					field : 'updateTime', 
					title : '更新时间' 
				},
				{
					field : 'remark', 
					title : '客服简介' 
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>